<template>


    <div class="movie-wrapper">

      <div class="movie-top-wrapper">
        <!--<videoScroll :videoData="videoScroll"></videoScroll>-->
        <div class="movie-top-scroll">
          <movieTopScroll :movieTopScrollData="movieTopScroll.data"></movieTopScroll>
        </div>
        <div class="movie-top-box">
          <movieTopItem :movieTopItemData="movieTopItem"></movieTopItem>
        </div>
      </div>


      <div class="select-animation">
        <selectCategory :selectData="selectAnimation" :selectTopData="selectAnimationTop"></selectCategory>
      </div>

    </div>

</template>

<script>
  import movieTopItem from '../../components/movie/movieTopItem'
  import movieTopScroll from '../../components/movie/movieTopScroll'
  import selectCategory from '../../components/movie/selectCategory'
  import Mock from 'mockjs';

  const ERROR = 0;
export default {
  data() {
    return {
      movieTopScroll: {},
      movieTopItem: {},
      selectAnimation: {},
      selectAnimationTop: {}
    };
  },
  components: {
    movieTopItem,
    selectCategory,
    movieTopScroll
  },
  created() {
    this.$http.get('http://rap.taobao.org/mockjs/12149/api/video_scroll?accessToken=aaa').then((response) => {
      response = response.body;
      if (Mock.mock(response).errno === ERROR) {
        this.movieTopScroll = Mock.mock(response);
      }
    });
    this.$http.get('http://rap.taobao.org/mockjs/12149/api/video_top?accessToken=asdas').then((response) => {
      response = response.body;
      if (Mock.mock(response).errno === ERROR) {
          console.log(Mock.mock(response))
        this.movieTopItem = Mock.mock(response);
      }
    });
    this.$http.get('http://rap.taobao.org/mockjs/12149/api/video_animation?accessToken=zxcz').then((response) => {
      response = response.body;
      if (Mock.mock(response).errno === ERROR) {
        this.selectAnimation = Mock.mock(response);
      }
    });
    this.$http.get('http://rap.taobao.org/mockjs/12149/api/video_animation_top?accessToken=ewrew').then((response) => {
      response = response.body;
      if (Mock.mock(response).errno === ERROR) {
        this.selectAnimationTop = Mock.mock(response);
      }
    });
  }
}
</script>

<style scoped lang="scss" rel="stylesheet/scss">

    .movie-wrapper{
      margin: 0 auto;
      width: 1160px;
      .movie-top-wrapper{
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        .movie-top-scroll{
          width: 400px;
          height: 220px;
        }
        .movie-top-box{
          width: 700px;
          height: 220px;
        }
      }
      .select-animation{
        margin-top: 20px;
        width: 100%;
        height: 365px;
      }
      .select-ghost{
        margin-top: 20px;
        width: 100%;
        height: 365px;
      }
    }

</style>
